const path = require('path')

function resolve (dir) {
  return path.join(__dirname, dir)
}

module.exports = {
  publicPath: process.env.PUBLIC_PATH,
  pages: {
    index: {
      entry: 'src/main.js',
      template: 'public/index.html',
      title: 'CAM',
      filename: 'index.html'
    },
    dataView: {
      entry: 'src/pages/dataView/main.js',
      template: 'public/index.html',
      title: 'DataView',
      filename: 'dataView.html'
    }
  },
  configureWebpack: {
    resolve: {
      alias: {
        '@': resolve('src'),
        '@views': resolve('src/views')
      }
    }
  },
  devServer: {
    port: 13000,
    proxy: {
      '/api': {
        target: 'http://127.0.0.1:13001',
        pathRewrite: {
          '^/api': ''
        }
      }
    }
  },
  lintOnSave: false
}
